<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      #template {
        display: none;
      }
    </style>
  </head>
  <body>
    <!-- 
        <h1 @click="add" v-memo="[state]">{{count}}</h1>
        <h1 @click="toggle">toggleState</h1>
     -->
    <div id="template">
        <h1 @click="add" v-memo="[state]">{{count}}</h1>
        <h1 @click="toggle">toggleState</h1>
    </div>
    <div id="app"></div>
    <script src="../../../../packages/vue/dist/vue.global.js"></script>

    <script>
      const { createApp, ref } = Vue

      const template = document.querySelector('#template')?.innerHTML
      const App = {
        setup() {
          const count = ref(2)
          const state = ref(false)
          const add = () => count.value++
          const toggle = () => state.value = !state.value
          return {
            count,
            add,
            state,
            toggle
          }
        },
        template
      }

      createApp(App).mount('#app')
    </script>
  </body>
</html>
